<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // var arr1 = [];
  // var arr3 = [];
  // var arr2 = new Array();

  // console.log(arr1 === arr2);
  // console.log(arr1 === arr3);

  // console.log(arr1);
  // console.log(arr2);

  // 任何两个对象都不相等

  var arr1 = [4];
  var arr2 = new Array(4);
  
  // 有且只有一个数值型数据时，字面量会将该数值作为数组的数据；构造函数将该数值作为数组的长度，每个位置为undefined

  console.log(arr1);
  console.log(arr1.length);

  console.log(arr2);
  console.log(arr2.length);
  console.log(arr2[0]);
  console.log(arr2[1]);
  console.log(arr2[2]);
  console.log(arr2[3]);

  
</script>
</html>